<div class="console-panel createAPI1">
    <div class="console-panel-header">
        <span class="console-panel-header-line"></span>
        <div class="console-float-left ng-binding" style="font-weight: bold;">基本配置</div>
    </div>
    <div class="console-panel-body console-p4 console-pt6 console-pb6">
        <div class="console-form">
            <div class="console-form-row clearfloat">
                <div class="console-form-header ng-binding">
                    <span class="red">* </span>API名称
                </div>
                <div class="console-form-body">
                    <input type="text" id="apiName" <#if context.api?? >disabled="disabled"</#if>
                           style="background-color: #EEEEEE;"
                           class="form-control w-25"
                           placeholder="请输入API的名称"
                           value="<#if context.api?? >${context.api.apiName}</#if>">
                </div>
            </div>
            <div class="console-form-row clearfloat">
                <div class="console-form-header ng-binding">
                    <span class="red">* </span>API描述
                </div>
                <div class="console-form-body">
                    <textarea type="text" id="apiDescribe"
                              class="form-control w-50"
                              maxlength="90"
                              placeholder="请用一句话描述该API的作用"><#if context.api?? >${context.api.apiDescribe!}</#if></textarea>
                </div>
            </div>
            <!--安全认证配置,当有新的认证方式只需要在select中添加一个option值,值的内容时处理器在工厂中的名字-->
            <div class="console-form-row clearfloat">
                <div class="console-form-header ng-binding">安全认证</div>
                <div class="console-form-body">
                    <select id="auth-options-name"
                            class="form-select w-25">
                        <#if context.api?? && context.api.authOptions?exists>
                            <option value="${context.api.authOptions.inFactoryName}"
                                    class="ng-binding">${context.api.authOptions.inFactoryName}</option>
                        </#if>
                        <option value="none" class="ng-binding">不认证</option>
                        <option value="SessionTokenAuth" class="ng-binding">Session-Token</option>
                        <option value="JWTTokenAuth" class="ng-binding">JWT-Token</option>
                    </select>
                </div>
            </div>

            <div class="console-form-row clearfloat auth-hide-show">
                <div class="console-form-header ng-binding">
                    <span class="red">* </span>认证配置文件
                </div>
                <div class="console-form-body">
                        <textarea type="text" id="auth-options-config" rows="6"
                                  class="form-control w-50"
                                  placeholder="请输入认证需要的配置文件json格式"><#if context.api?? && context.api.authOptions?exists>${context.api.authOptionBody!}</#if></textarea>
                </div>
            </div>

            <div class="console-form-row clearfloat">
                <div class="console-form-header ng-binding">访问限制/单位</div>
                <div class="console-form-body">
                    <select id="limitUnit"
                            class="form-select w-25">
                        <#if context.api?? && context.api.limitUnit?exists>
                            <option value="${context.api.limitUnit}"
                                    class="ng-binding">${context.api.limitUnit}</option>
                        </#if>
                        <option value="none" class="ng-binding">不限制</option>
                        <option value="DAYS" class="ng-binding">一天</option>
                        <option value="HOURS" class="ng-binding">一小时</option>
                        <option value="MINUTES" class="ng-binding">一分钟</option>
                    </select>
                </div>
            </div>
            <div class="console-form-row clearfloat limit-hide-show">
                <div class="console-form-header ng-binding">API访问次数</div>
                <div class="console-form-body">
                    <input type="text" id="apiLimit"
                           <#if context.api?? && context.api.limitUnit?exists>value="${context.api.apiLimit}"</#if>
                           placeholder="请输入API在限制单位中最大访问次数,默认-1无限制"
                           class="form-control w-25">
                </div>
            </div>
            <div class="console-form-row clearfloat limit-hide-show">
                <div class="console-form-header ng-binding">IP访问次数</div>
                <div class="console-form-body">
                    <input type="text" id="ipLimit"
                           <#if context.api?? && context.api.limitUnit?exists>value="${context.api.ipLimit}"</#if>
                           placeholder="请输入用户IP在限制单位中最大访问次数,默认-1无限制"
                           class="form-control w-25">
                </div>
            </div>
        </div>
    </div>
</div>

<!--前置与后置处理器,当有新的处理器只需要在select中添加一个option值,值的内容时处理器在工厂中的名字-->
<div class="console-panel createAPI1" style="margin-top:15px;">
    <div class="console-panel-header">
        <span class="console-panel-header-line"></span>
        <div class="console-float-left ng-binding" style="font-weight: bold;">前置与后置处理器</div>
    </div>
    <div class="console-panel-body console-p4 console-pt6 console-pb6">
        <div class="console-form-row clearfloat">
            <div class="console-form-header ng-binding">前置处理器</div>
            <div class="console-form-body">
                <select id="beforeHandler"
                        class="form-select w-25">
                    <#if context.api?? && context.api.beforeHandlerOptions?exists>
                        <option value="${context.api.beforeHandlerOptions.inFactoryName}"
                                class="ng-binding">${context.api.beforeHandlerOptions.inFactoryName}</option>
                    </#if>
                    <option value="none" class="ng-binding">不启用</option>
                    <option value="BeforeHandlerFactory" class="ng-binding">测试</option>
                    <!--<option value="这里填写前置处理器在工厂中的名字" class="ng-binding">option</option>-->
                </select>
            </div>
        </div>

        <div class="console-form-row clearfloat beforeHandler-hide-show">
            <div class="console-form-header ng-binding">
                <span class="red">* </span>前置处理器配置文件
            </div>
            <div class="console-form-body">
                    <textarea type="text" id="beforeHandlerOptions" rows="6"
                              class="form-control w-50"
                              placeholder="请输入前置处理器需要的配置文件json格式"><#if context.api?? && context.api.beforeHandlerOptions?exists>${context.api.beforeHandlerOptionsBody!}</#if></textarea>
            </div>
            <span>填写前置处理器在工厂中的名字</span>
        </div>

        <div class="console-form-row">
            <div class="console-form-header ng-binding">后置处理器</div>
            <div class="console-form-body">
                <select id="afterHandler"
                        class="form-select w-25">
                    <#if context.api?? && context.api.afterHandlerOptions?exists>
                        <option value="${context.api.afterHandlerOptions.inFactoryName}"
                                class="ng-binding">${context.api.afterHandlerOptions.inFactoryName}</option>
                    </#if>
                    <option value="none" class="ng-binding">不启用</option>
                    <option value="AfterHandlerFactory" class="ng-binding">测试</option>
                    <!--<option value="这里填写后置处理器在工厂中的名字" class="ng-binding">session-token</option>-->
                </select>
            </div>
        </div>

        <div class="console-form-row clearfloat afterHandler-hide-show">
            <div class="console-form-header ng-binding">
                <span class="red">* </span>后置处理器配置文件
            </div>
            <div class="console-form-body">
                <textarea id="afterHandlerOptions" type="text" rows="6"
                          class="form-control w-50"
                          placeholder="请输入后置处理器需要的配置文件json格式"><#if context.api?? && context.api.afterHandlerOptions?exists>${context.api.afterHandlerOptionsBody!}</#if></textarea>
            </div>
            <span>填写后置处理器在工厂中的名字</span>
        </div>
    </div>
</div>
